/*
 * KP ebdesk
 */
package com.ebdesk.controller.masterdata;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 *
 * @author Zulfikar
 */
public abstract class Validator {
    public static boolean isSamePassword(String password, String rePassword) {
        return password.equals(rePassword);
    }
    
    private static final String EMAIL_PATTERN = "^[_A-Za-z0-9-]+(\\.[_A-Za-z0-9-]+)*@[A-Za-z0-9]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";
 
    public static boolean isValidEmail(final String hex){
        Pattern pattern = Pattern.compile(EMAIL_PATTERN);
                  
        Matcher matcher = pattern.matcher(hex);

        return matcher.matches();
    }
}
